import tkinter as tk
from tkinter import ttk
 
def change_cell_color(event):
    # 获取事件相关信息
    column = tree.identify_column(event.x)
    row = tree.identify_row(event.y)
    
    # 如果点击在了第一列，则改变文字颜色为红色
    if column == "#1":
        tree.tag_configure('red_text_tag', foreground='red')
        tree.set('item', 'column1', 'new text', tag='red_text_tag')
 
root = tk.Tk()
 
# 创建Treeview组件
tree = ttk.Treeview(root, columns=('column1', 'column2'))
tree.heading('#0', text='Item')
tree.heading('column1', text='Column 1')
tree.heading('column2', text='Column 2')
 
# 插入数据
tree.insert('', 'end', text='item', values=('value1', 'value2'))
 
# 绑定点击事件
tree.bind("<Button-1>", change_cell_color)
 
tree.pack(fill=tk.BOTH, expand=True)
 
root.mainloop()